function checkNewCat(){
    var cat=document.getElementById("new_category").value
    var catErr=document.getElementById("newCat");
    catErr.innerHTML="";
    var ret=true;
    if(cat==''){
	catErr.innerHTML="Insert at least 1 character";
	ret=false;
    }
    return ret;
}

function checkEditCat(){
    var cat=document.getElementById("edit_category").value
    var catErr=document.getElementById("editCatErr");
    catErr.innerHTML="";
    var ret=true;
    if(cat==''){
	catErr.innerHTML="Insert at least 1 character";
	ret=false;
    }
    return ret;
}

function checkNewQuest(){
    var quest=document.getElementById("new_question").value
    var ans=document.getElementById("new_answer").value
    var questErr=document.getElementById("newQuestErr");
    var ansErr=document.getElementById("newAnsErr");
    questErr.innerHTML="";
    ansErr.innerHTML="";
    var ret=true;
    if(quest==''){
	questErr.innerHTML="Insert at least 1 character";
	ret=false;
    }
    if(ans==''){
	ansErr.innerHTML="Insert at least 1 character";
	ret=false;
    }
    return ret;
}

function checkEditQuest(){
    var quest=document.getElementById("edit_question").value
    var ans=document.getElementById("edit_answer").value
    var questErr=document.getElementById("editQuestErr");
    var ansErr=document.getElementById("editAnsErr");
    questErr.innerHTML="";
    ansErr.innerHTML="";
    var ret=true;
    if(quest==''){
	questErr.innerHTML="Insert at least 1 character";
	ret=false;
    }
    if(ans==''){
	ansErr.innerHTML="Insert at least 1 character";
	ret=false;
    }
    return ret;
}




